import http from '@/api/http'

// 商家加载信息
export const index = (data) => {
	return http.get('/shop/index',)
}

// 申请商家
export const apply = (data) => {
	return http.post('/shop/apply_shop', data)
	// return http.post('/shop/signUp', data)
}

// 申请商家
export const createSignature = (data) => {
	return http.post('/rsa_sign/createSignature', data)
	// return http.post('/shop/signUp', data)
}


// 商家入驻--类型选择
export const getType = () => {
	return http.post('/shop/shop_type')
}
// 商家入驻--获取类型说明
export const getAgreement = (data) => {
	return http.post('/shop/type_explain',data)
}
// 申请商家进度
export const applyInfo = () => {
	return http.get('/shop/applyInfo')
}
//商家资料
export const profile = () => {
	return http.get('/shop/profile')
}
//商家资料修改
export const profileUpdate = (data) => {
	return http.post('/shop/profileUpdate', data)
}

//商家资料
export const chainUser = (data) => {
	return http.post('/shop/chainUser',data)
}

//商家资料修改
export const settingUpdate = (data) => {
	return http.post('/shop/settingUpdate', data)
}



// 商家收款码
export const shopQrcode = () => {
	return http.get('/shop/shopQrcode')
}

// 商家收款码
export const reggetOpenid = (data) => {
	return http.post('/Userlevel/reggetOpenid',data)
}

// 商家收款码
export const getappCode = (data) => {
	return http.post('/Userlevel/getappCode',data)
}


//商家收款码
export const getshopQrcode = (data) => {
	return http.post('/shop/getshopQrcode',data)
}

// 商家支付宝授权
export const shopAli = () => {
	return http.get('/shop/shopAli')
}
// 商家订单
export const orderList = (data) => {
	return http.get('/shop/orderList', data)
}
// 商家收益
export const rebateList = () => {
	return http.get('/shop/rebateList')
}
// 商家粉丝
export const fansList = () => {
	return http.get('/shop/fansList')
}

// 商家粉丝
export const chainList = () => {
	return http.get('/shop/chainList')
}

// 商家粉丝
export const chainAll = (data) => {
	return http.post('/shop/chainAll',data)
}

// 商家粉丝
export const chainAdd = (data) => {
	return http.post('/shop/chainAdd',data)
}

// 商家粉丝
export const chainShop = () => {
	return http.get('/shop/chainShop')
}

//连锁审核
export const chainJoin = (data) => {
	return http.post('/shop/chainJoin',data)
}

//联盟审核
export const allianceJoin = (data) => {
	return http.post('/shop/allianceJoin',data)
}


// 商家粉丝
export const chainCheck = () => {
	return http.get('/shop/chainCheck')
}



// 商家广告投放
export const shopWord = (data) => {
	return http.post('/shop/word', data)
}
// 商家广告投放
export const delShopWord = () => {
	return http.post('/shop/delword',{})
}
// 商家获取新老用户
export const orderUser = (data) => {
	return http.get('/shop/orderUser?type='+data.type)
}
// 用户获取积分商品详情
export const productDetails = (data) => {
	return http.get('/stroe/productDetails?pid='+data.pid)
}
// 用户兑换积分商品
export const orderPro = (data) => {
	return http.post('/stroe/orderPro', data)
}
// 用户获取积分商品兑换列表
export const orderRrcord = (data) => {
	return http.get('/stroe/orderList', data)
}
// 用户获取收货地址列表
export const addressList = (data) => {
	return http.get('/stroe/address_list', data)
}
// 用户设置默认收获地址
export const takeDefaults = (data) => {
	return http.get('/stroe/address_default_set', data)
}
// 用户设置编辑收获地址edits
export const editsAddress = (data) => {
	return http.get('/stroe/address_edit', data)
}
// 用户设置编辑收获地址edits
export const getOnce = (data) => {
	return http.get('/stroe/address', data)
}
// 用户设置删除收获地址
export const delOnce = (data) => {
	return http.post('/stroe/address_del', data)
}
// 商户获取已分享商户列表
export const getShareList = (data) => {
	return http.post('/shop/shopShareList', data)
}
// 商户发放优惠券s
export const setShopCoupon = (data) => {
	return http.post('/shop/setShopCoupon', data)
}
// 商户优惠券管理列表
export const shopCouponList = (data) => {
	return http.post('/shop/ShopCouponList', data)
}
// 优惠券停止发放
export const upShopCoupon = (data) => {
	return http.post('/shop/upShopCoupon', data)
}
// 优惠券删除
export const delShopCoupon = (data) => {
	return http.post('/shop/delShopCoupon', data)
}

// 会员升级
export const userlevel = (data) => {
	return http.post('/Userlevel/apply', data)
}

// 会员升级
export const getOpenid = (data) => {
	return http.post('/Userlevel/getOpenid', data)
}


// 用户粉丝
export const usersList = () => {
    return http.get('/shop/usersList')
}

// 商家入驻--类型选择
export const getCategory = () => {
	return http.get('/shop/getCategory')
}


// 商家入驻--类型选择
export const H5Sdk = (data) => {
	return http.post('/Sand_Pay_Service/H5Sdk',data)
}

export const machine = (data) => {
	return http.post('/Wifiprint/machineList',data)
}

export const machineUpdate = (data) => {
	console.log(data)
	return http.post('/Wifiprint/machineUpdate',data)
}

export const speaker = (data) => {
	return http.post('/Wifiprint/speakerList',data)
}

export const speakerUpdate = (data) => {
	console.log(data)
	return http.post('/Wifiprint/speakerUpdate',data)
}

export const pollOrderStatus = (data) => {
	console.log(data)
	return http.post('/Scanpay/pollOrderStatus',data)
}

// 新用户页面微信分享领券
export const scan = (params) => {
    return http.post('/Scanpay/scan',params)
}

export const ali_scan = (params) => {
    return http.post('/rsa_sign/ali_scan',params)
}

export const fastQrcode = (params) => {
    return http.post('/shop/FastQrcode',params)
}

export const wechatQrcode = (params) => {
    return http.post('/shop/wechatQrcode',params)
}



export const detail = (params) => {
    return http.post('/shop/detail',params)
}




export default {
	wechatQrcode,
	detail,
	fastQrcode,
	ali_scan,
	createSignature,
	speakerUpdate,
	speaker,
	scan,
	pollOrderStatus,
	allianceJoin,
	getshopQrcode,
	reggetOpenid,
	machineUpdate,
	machine,
	chainUser,
	H5Sdk,
	getCategory,
	usersList,
	getOpenid,
	userlevel,
	settingUpdate,
	index,
	apply,
	upShopCoupon,
	delShopCoupon,
	applyInfo,
	shopCouponList,
	setShopCoupon,
	takeDefaults,
	getOnce,
	getShareList,
	delOnce,
	profile,
	profileUpdate,
	shopQrcode,
	orderList,
	rebateList,
	fansList,
	chainList,
	addressList,
	orderRrcord,
	shopWord,
	delShopWord,
	editsAddress,
	productDetails,
	orderPro,
	getType,
	getAgreement,
	orderUser,
	shopAli,
	chainAll,
	chainAdd,
	chainShop,
	chainJoin,
	chainCheck
}
